class Game(object):
	
	def __init__(self):
		
		self.welcome = "Welcome message goes here"
		self.error_text = "Error text goes here"
		self.congrats_text = "Congratulations! You win!"
		self.loser_text = "Hahaha you're a loser."
		self.play_again_text = "Play again? (y/n)"
		
		self.give_help = True
		self.help_character = '?'
		self.help_text = "type %s to view choices" % self.help_character
		
		self.first_room = None
		self.next_room = None
		self.last_rooms = None
		self.keep_playing = True
	
	#Prints welcome message, starts game loop, determines a win or loss
	def play(self):
		
		print "\n", self.welcome
		
		while self.keep_playing == True:
			self.playRoom(self.first_room)
			
			while self.next_room not in self.last_rooms:
				self.playRoom(next_room)
			
			print self.next_room.description
			if self.next_room.lose == True:
				print self.loser_text
			
			else:
				print self.congrats_text
			
			print self.play_again_text
			play_again_choice = raw_input("> ")
			
			if play_again_choice == "q":
				self.keep_playing = False
			
				
	#Prints room description, gets next room choice	
	def playRoom(self, room):
		
		print "\n"
		print room.description
		print "\n"
		chosen = False
		
		while not chosen:
		
			room.choice = raw_input("\n> ")
			
			if room.choice in room.choices:
				
				self.next_room = room.choices[room.choice]
				chosen = True
			
			elif room.choice == self.help_character:
				
				for a_choice in room.choices:
						print a_choice
			
			elif (room.choice == "quit" or room.choice == "exit" or room.choice == "Quit"
					or room.choice == "Exit"):
				
				exit(1)
			
			else:
				
				print self.error_text
				if self.give_help == True:
				
					print self.help_text
			
			
					
					
			
		
			

class Room(object):
	
	def __init__(self):
	
		#Define room description as a string
		self.description = "This is where you define a description of the room"
		
		#Define choices as strings in a tuple
		self.choices = None
		
		#For setting next room choice
		self.choice = None
		
		#Is the room a 'losing' room?
		self.lose = False
		

		